Conversation
- Add page head theme-stored/preference-driven light/dark toggle - Add topnav button to toggle light/dark - Defaults to light mode if not set - Add dark-mode color overrides to main.css - Upgrade to jekyll 4.4 - Upgrade to webrick 1.9 jekyll plugin - Upgrade to bootstrap 5.3.3 - Remove popper.js (it's part of bootstrap now) - Remove jQuery and just use standard browser - Replace attributes data-toggle -> data-bs-toggle (for accordions/nav menu) - Replace attributes data-target -> data-bs-target (for nav menu) - Replace attributes data-parent -> data-bs-parent (for menus) - Replace attributes data-ride -> data-bs-ride (for carousel) - Replace attributes ml-auto -> ms-auto (for nav menu) - Use bootstrap color CSS variables - Add adjustments to main.scss for links and jumbotron to retain appearance - Add theme management to page.js and upgrade to remove jQuery - Eliminate incompatible github-pages plugin and use standard github workflow
| @@ -0,0 +1,51 @@ | |||
| name: Deploy Jekyll site to Pages | |||
There was a problem hiding this comment.
I'm not sure this can be done like this, but the current versions of jekyll do NOT work with the github-pages Gem, so we have to remove that and use GitHub Actions workflow instead.
Obviously, I cannot tell if this will work because I don't have your tokens/secrets... so let me know if you need me to adjust.
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <meta name="color-scheme" content="light dark"> | ||
| <script> |
There was a problem hiding this comment.
Prevents flash of light/dark on page load and respects local-store setting of theme. Falls back to browser preference using matchMedia
| integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script> | ||
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" | ||
| integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" |
There was a problem hiding this comment.
Upgrade to bootstrap 5.3.3 for free dark/light mode support.
Popper is included in 5.x
| </a> | ||
|
|
||
| <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | ||
| <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> |
There was a problem hiding this comment.
Bootstrap 5.x changed the data attributes to include the -bs- to avoid collisions, so we change those all over.
| <li {% if page.sectionid=='specification' %} class="nav-item active" {% else %} class="nav-item" {% endif %}> | ||
| <a class="nav-link" href='{{ "/specifications/specification-current" | prepend: site.baseurl }}'>Specification</a> | ||
| </li> | ||
| <li class="nav-item"> |
There was a problem hiding this comment.
This is the menu-line toggle (shows a sun or moon)
| @@ -1,5 +1,5 @@ | |||
| <!DOCTYPE html> | |||
| <html lang="en"> | |||
| <html lang="en" data-bs-theme="light"> | |||
There was a problem hiding this comment.
Ensure if there's no preference or mode previously selected, we fall back to light so it doesn't change appearance too much.
There is a lot of improvements in Bootstrap 5.x for fonts and sizing and such, so it's not an exact match, but it's better.
| letter-spacing: .25px; | ||
| text-rendering: optimizeLegibility; | ||
| color: #242628; | ||
| color: var(--bs-body-color, #242628); |
There was a problem hiding this comment.
Ensure we work with bootstrap theming and fall-back to our old colors all over.
| top: -60px; | ||
| left: 0; | ||
| } | ||
|
|
There was a problem hiding this comment.
This section is to fix some differences in the way the sidebars rendered in 5.x (missing padding and colors) which resulted from CSS specificity issues.
| color: var(--bs-secondary-color, #707070); | ||
| } | ||
|
|
||
| div.page-content > div.wrapper > div.header-container.bg-primary.jumbotron { |
There was a problem hiding this comment.
This was added to fix the index page, which rendered with a white bar between the navigation/menu bar and the "jumbotron" header.
| margin-top: -1em; | ||
| } | ||
|
|
||
| // Theme toggle button |
There was a problem hiding this comment.
The rest of these changes are for dark-mode color overrides.
| function onConsentChanged() { | ||
| function gtag() { | ||
| window.dataLayer.push(arguments) | ||
| document.addEventListener('DOMContentLoaded', function () { |
There was a problem hiding this comment.
Removed jQuery and use standard browser DOM stuff now.
| }); | ||
| } | ||
|
|
||
| // Theme toggle |
| layout: default | ||
| --- | ||
|
|
||
| <!-- Place this tag in your head or just before your close body tag. --> |
There was a problem hiding this comment.
This was complete duplicate since it was already rendered in the footer.
Closes #2204